import requests
def getHtml(url):
    try:
        res = requests.get(url,timeout=0.5)
        prinnt(res.status_code)
        print(res.text)
        except:
            print("get http error")

if __name__=="__main__":
    url='http://github.com/'
    getHtml(url)            
#url='http://search.zongheng.com/'
#url='https://www.httpbin.org/get'
#url='https://www.dianping.com/'

#header={
   #'User-Agent': 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36'
#}

#res=requests.get(url,headers=header)
#search = "武侠"
#data={"keywprd":search}
#res = requests.post(url,params=data)
#res = requests.get(url)

#print(res.status_code)
#print(res.text)
#temp = res.json()

#print(type(temp))
#print(temp["headers"]["User-Agent"])

